package com.ruoyi.common.core.domain.entity;

import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * 停车规则配置实体类
 *
 * @author ruoyi
 */
public class RuleConfig extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 规则名称 */
    @Xss(message = "规则名称不能包含脚本字符")
//    @NotBlank(message = "规则名称不能为空")
    @Size(min = 0, max = 255, message = "规则名称长度不能超过255个字符")
    private String ruleName;

    /** 非会员收费（元/小时） */
//    @NotNull(message = "非会员收费不能为空")
    private BigDecimal nonMemberFee;

    /** 会员免费时长（分钟） */
//    @NotNull(message = "会员免费时长不能为空")
    private Integer memberFreeMinutes;

    /** 积分抵扣状态（1=启用，2=不启用） */
//    @NotNull(message = "积分抵扣状态不能为空")
    private Integer pointDeduction;

    /** 积分兑换比例（积分/小时） */
    private BigDecimal pointExchangeRatio;

    /** 单日积分抵扣上限（小时） */
    private Integer pointDeductionLimit;

    /** 停车券抵扣状态（1=启用，2=不启用） */
//    @NotNull(message = "停车券抵扣状态不能为空")
    private Integer couponDeduction;

    /** 收费上限（元/天） */
    private BigDecimal chargeCapping;

    public BigDecimal getChargeCapping() {
        return chargeCapping;
    }

    public void setChargeCapping(BigDecimal chargeCapping) {
        this.chargeCapping = chargeCapping;
    }



    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    /** 删除标志（0-正常，1-已删除） */
    private Integer deleted;

    // 构造方法
    public RuleConfig() {}

    public RuleConfig(Long id) {
        this.id = id;
    }

    // Getter 和 Setter
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRuleName() {
        return ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }

    public BigDecimal getNonMemberFee() {
        return nonMemberFee;
    }

    public void setNonMemberFee(BigDecimal nonMemberFee) {
        this.nonMemberFee = nonMemberFee;
    }

    public Integer getMemberFreeMinutes() {
        return memberFreeMinutes;
    }

    public void setMemberFreeMinutes(Integer memberFreeMinutes) {
        this.memberFreeMinutes = memberFreeMinutes;
    }

    public Integer getPointDeduction() {
        return pointDeduction;
    }

    public void setPointDeduction(Integer pointDeduction) {
        this.pointDeduction = pointDeduction;
    }

    public BigDecimal getPointExchangeRatio() {
        return pointExchangeRatio;
    }

    public void setPointExchangeRatio(BigDecimal pointExchangeRatio) {
        this.pointExchangeRatio = pointExchangeRatio;
    }

    public Integer getPointDeductionLimit() {
        return pointDeductionLimit;
    }

    public void setPointDeductionLimit(Integer pointDeductionLimit) {
        this.pointDeductionLimit = pointDeductionLimit;
    }

    public Integer getCouponDeduction() {
        return couponDeduction;
    }

    public void setCouponDeduction(Integer couponDeduction) {
        this.couponDeduction = couponDeduction;
    }

    // 重写 toString 方法
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("ruleName", getRuleName())
                .append("nonMemberFee", getNonMemberFee())
                .append("memberFreeMinutes", getMemberFreeMinutes())
                .append("pointDeduction", getPointDeduction())
                .append("pointExchangeRatio", getPointExchangeRatio())
                .append("pointDeductionLimit", getPointDeductionLimit())
                .append("couponDeduction", getCouponDeduction())
                .append("chargeCapping", getChargeCapping())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("deleted", getDeleted())
                .toString();
    }
}
